package bean.validate;

import java.io.Serializable;
import java.util.Map;

import javax.faces.application.FacesMessage;
import javax.faces.bean.ManagedBean;
import javax.faces.bean.ManagedProperty;
import javax.faces.bean.RequestScoped;
import javax.faces.bean.ViewScoped;
import javax.faces.context.FacesContext;

@ManagedBean(name="pv")
@RequestScoped
public class ProductValidate implements Serializable {
	private static final long serialVersionUID = 8048446519596040884L;
	
	private String form = "form_add_product";
	// Validation
	
	private void message(String field){
		FacesMessage message = new FacesMessage(FacesMessage.SEVERITY_INFO, null, "ok");
		FacesContext.getCurrentInstance().addMessage(form + ":" + field, message);
	}
	
	public void name() {
		this.message("name");
	}
	
	public void state() {
		this.message("state");
	}
	
	public void city() {
		this.message("city");
	}

	public void country() {
		this.message("country");
	}
	
	public void quantity() {
		this.message("quantity");
	}
	
	public void measure() {
		this.message("measure");
	}
	
	public void description() {
		this.message("description");
	}
	
	public void operation() {
		this.message("operation");
	}
	
	public void locale() {
		this.message("locale");
	}


}
